home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / Anim / Dissolve / Liquid < prev    next >
Text File  |  2001-10-01  |  1KB  |  101 lines

  1. /* Dissolve Circle
  2. 110
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.  
  9.     parse ARG Port Opt1 Opt2 Opt3 s0 t0 s1 t1 b
  10.     
  11.     ADDRESS value Port
  12.  
  13.     pp_GetWidth
  14.     w=result
  15.     pp_GetHeight
  16.     h=result
  17.     pp_GetDepth
  18.     D=result
  19.  
  20.     pp_GetCurrentBuffer
  21.     CBf=result
  22.     pp_GetCurrentBrush
  23.     CB=result
  24.  
  25.     pp_FindEmptyBrush
  26.     Brush=result
  27.     if Brush=-1 then DO
  28.         pp_Warn "can't*find*empty|Brush."
  29.         EXIT        
  30.     END
  31.     pp_SetBrush Brush        
  32.  
  33.     pp_FindEmptyBuffer
  34.     Bf=result
  35.     if Bf=-1 then DO
  36.         pp_Warn "can't*find*empty|Buffer."
  37.         EXIT        
  38.     END
  39.     pp_SetBuffer Bf
  40.  
  41.     pp_New w h 24
  42.     pp_SpareOnOff
  43.  
  44.     /* Draw your Mask */
  45.         pp_EffectOn
  46.         pp_ComposeReqOff
  47.         pp_Liquid 2 13 12 15 0
  48.         pp_BoxF 0 0 w-1 h-1
  49.         pp_ComposeReqOn
  50.         pp_EffectOff
  51.     /*    End    */
  52.     
  53.     pp_SparetoStencil
  54.     IF Opt2=1 then DO
  55.         pp_InvStencil
  56.     END    
  57.     pp_SSave "ram:DisSten"
  58.     pp_ClearCurrentBuffer
  59.     pp_SetBuffer CBf
  60.  
  61.     pp_SLoad "ram:DisSten"
  62.     ADDRESS COMMAND
  63.     'delete >nil: ram:DisSten'
  64.     ADDRESS value Port
  65.  
  66.     pp_GotoFrame s1
  67.     pp_PicttoSpare
  68.     pp_GotoFrame s0            
  69.     pp_Pickbrush 0 0 W H 1
  70.     
  71.     step=(s1-s0)
  72.     Step_f=255/Step
  73.  
  74.     DO i=s0+1 to s1
  75.         IF t1=1 then DO
  76.             pp_GotoFrame (s1+i-s0)
  77.             pp_PicttoSpare
  78.         END
  79.  
  80.         pp_GotoFrame i
  81.  
  82.         IF t0=0 then DO
  83.             pp_plot W/2 H/2
  84.         END
  85.  
  86.         f=Step_f*(i-s0)
  87.         IF Opt1=0 then DO
  88.             pp_Dissolve f 255            
  89.         END
  90.         ELSE DO
  91.             pp_Dissolve f f
  92.         END
  93.         pp_Refresh
  94.     END
  95.  
  96.         pp_Gotoframe s0
  97.         pp_FreeBrush
  98.         pp_SetBrush CB
  99.  
  100.     EXIT
  101.